<?php
class Zwei_Utils_String {
	
	public function mask($haystack, $char_list,$cut_chars=false) {
		$haystack = str_split($haystack);
		$newstr = array();
		foreach($haystack as $letter) 
			if((boolean)strpos($char_list,$letter)!==(boolean) $cut_chars) 
				$newstr[] = $letter;
		return implode('',$newstr);
	}
}